<?php
/*
Template Name: Buzzr Frontpage

PLEASE NOTE CHECK PODS BLANK PAGE THIS PAGE IS NOT BEING USED ANYMORE


*/
?>
<?php get_header(); ?>
        <?php pods_content(); ?>
		<div id="featured" >
	<ul class="ui-tabs-nav">
<?php
$Record = new Pod('deal');
$Record->findRecords('id DESC', 5, 't.slider = true');
$counter = 0;
while ($Record->fetchRecord())
{
$counter++;
//echo $Record2->pod_helper('firstimage', $Record2->get_field('image'));
?>
<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-<?php echo $counter; ?>">
<a href="#fragment-<?php echo $counter; ?>">
<img src="<?php echo $Record->pod_helper('firstimagepushguid', $Record->get_field('image.guid')); ?>">
</a>
</li>
<?php
}
?>
</ul>
<?php
$counter = 0;
$Record2 = new Pod('deal');
$Record2->findRecords('id DESC', 5, 't.slider = true');
while ($Record2->fetchRecord())
{
$counter++;
?>
<div id="fragment-<?php echo $counter; ?>" class="ui-tabs-panel">
		<div class="sliderimage"><img src="<?php echo $Record2->pod_helper('firstimagepushguid', $Record2->get_field('image.guid')); ?>" /></div>
		<div class="info">
                <div class="writteninfo">
                <h2><a href="deals/<?php echo $Record2->get_field('camp_link'); ?>"><?php echo $Record2->get_field('name'); ?></a></h2>
		<p><?php echo $Record2->get_field('short'); ?> <a href="deals/<?php echo $Record2->get_field('camp_link'); ?>" >[read more]</a></p>
                </div>
                <div class="imagebrand"><?php echo $Record2->pod_helper('logomid', $Record2->get_field('brand.logo')); ?></div>
		</div>
	</div>
<?php
}
?>
</div>
<?php /*
<div class="advertiserlink"><a href="http://buzzr.in/advertisers">To promote your brand through Buzzr, click here</a></div>
*/ ?>
<div class="frontpage">
<?php
$Record3 = new Pod('deal');
$before_30_days = date("Y-m-d", strtotime('-30 days'));
// removed checking for start date - old is: $Record->findRecords('id DESC', 15, "t.camp_end >= NOW() && t.dealcheck='1' && t.camp_start <= NOW()");
//$Record3->findRecords('t.pageviews DESC', 10, "t.camp_end >= NOW() && t.dealcheck='1'");
$Record3->findRecords('t.pageviews DESC', 10, "t.camp_end >= NOW() && t.camp_start >='$before_30_days' && t.dealcheck='1'");
echo ('<div class="frontpagetitle">Most Popular Deals</div>');
echo $Record3->showTemplate('frontpage_list');
?>
</div>
<?php thematic_sidebar() ?>
<?php get_footer(); ?>
